home *** CD-ROM | disk | FTP | other *** search
/ Digital Background Bonanza / Digital Background Bonanza - Disc 1.iso / pc / DBB1.swf / scripts / __Packages / mx / video / UIManager.as < prev    next >
Encoding:
Text File  |  2007-03-09  |  58.4 KB  |  1,730 lines

  1. class mx.video.UIManager
  2. {
  3.    var _vc;
  4.    var _skin;
  5.    var _skinAutoHide;
  6.    var _skinReady;
  7.    var __visible;
  8.    var _bufferingBarHides;
  9.    var _controlsEnabled;
  10.    var _lastScrubPos;
  11.    var _lastVolumePos;
  12.    var cachedSoundLevel;
  13.    var _isMuted;
  14.    var controls;
  15.    var customClips;
  16.    var skin_mc;
  17.    var skinLoader;
  18.    var layout_mc;
  19.    var border_mc;
  20.    var _seekBarIntervalID;
  21.    var _seekBarInterval;
  22.    var _seekBarScrubTolerance;
  23.    var _volumeBarIntervalID;
  24.    var _volumeBarInterval;
  25.    var _volumeBarScrubTolerance;
  26.    var _bufferingDelayIntervalID;
  27.    var _bufferingDelayInterval;
  28.    var _bufferingOn;
  29.    var _skinAutoHideIntervalID;
  30.    var _progressPercent;
  31.    var uiMgr;
  32.    var state;
  33.    var _focusrect;
  34.    var controlIndex;
  35.    var placeholderLeft;
  36.    var placeholderRight;
  37.    var placeholderTop;
  38.    var placeholderBottom;
  39.    var videoLeft;
  40.    var videoRight;
  41.    var videoTop;
  42.    var videoBottom;
  43.    var _playAfterScrub;
  44.    static var version = "1.0.1.10";
  45.    static var shortVersion = "1.0.1";
  46.    static var PAUSE_BUTTON = 0;
  47.    static var PLAY_BUTTON = 1;
  48.    static var STOP_BUTTON = 2;
  49.    static var SEEK_BAR_HANDLE = 3;
  50.    static var BACK_BUTTON = 4;
  51.    static var FORWARD_BUTTON = 5;
  52.    static var MUTE_ON_BUTTON = 6;
  53.    static var MUTE_OFF_BUTTON = 7;
  54.    static var VOLUME_BAR_HANDLE = 8;
  55.    static var NUM_BUTTONS = 9;
  56.    static var PLAY_PAUSE_BUTTON = 9;
  57.    static var MUTE_BUTTON = 10;
  58.    static var BUFFERING_BAR = 11;
  59.    static var SEEK_BAR = 12;
  60.    static var VOLUME_BAR = 13;
  61.    static var NUM_CONTROLS = 14;
  62.    static var UP_STATE = 0;
  63.    static var OVER_STATE = 1;
  64.    static var DOWN_STATE = 2;
  65.    static var SKIN_AUTO_HIDE_INTERVAL = 200;
  66.    static var VOLUME_BAR_INTERVAL_DEFAULT = 250;
  67.    static var VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT = 0;
  68.    static var SEEK_BAR_INTERVAL_DEFAULT = 250;
  69.    static var SEEK_BAR_SCRUB_TOLERANCE_DEFAULT = 5;
  70.    static var BUFFERING_DELAY_INTERVAL_DEFAULT = 1000;
  71.    function UIManager(vc)
  72.    {
  73.       this._vc = vc;
  74.       this._skin = undefined;
  75.       this._skinAutoHide = false;
  76.       this._skinReady = true;
  77.       this.__visible = true;
  78.       this._bufferingBarHides = false;
  79.       this._controlsEnabled = true;
  80.       this._lastScrubPos = 0;
  81.       this._lastVolumePos = 0;
  82.       this.cachedSoundLevel = this._vc.volume;
  83.       this._isMuted = false;
  84.       this.controls = new Array();
  85.       this.customClips = undefined;
  86.       this.skin_mc = undefined;
  87.       this.skinLoader = undefined;
  88.       this.layout_mc = undefined;
  89.       this.border_mc = undefined;
  90.       this._seekBarIntervalID = 0;
  91.       this._seekBarInterval = mx.video.UIManager.SEEK_BAR_INTERVAL_DEFAULT;
  92.       this._seekBarScrubTolerance = mx.video.UIManager.SEEK_BAR_SCRUB_TOLERANCE_DEFAULT;
  93.       this._volumeBarIntervalID = 0;
  94.       this._volumeBarInterval = mx.video.UIManager.VOLUME_BAR_INTERVAL_DEFAULT;
  95.       this._volumeBarScrubTolerance = mx.video.UIManager.VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT;
  96.       this._bufferingDelayIntervalID = 0;
  97.       this._bufferingDelayInterval = mx.video.UIManager.BUFFERING_DELAY_INTERVAL_DEFAULT;
  98.       this._bufferingOn = false;
  99.       this._skinAutoHideIntervalID = 0;
  100.       this._vc.addEventListener("metadataReceived",this);
  101.       this._vc.addEventListener("playheadUpdate",this);
  102.       this._vc.addEventListener("progress",this);
  103.       this._vc.addEventListener("stateChange",this);
  104.       this._vc.addEventListener("ready",this);
  105.       this._vc.addEventListener("resize",this);
  106.       this._vc.addEventListener("volumeUpdate",this);
  107.    }
  108.    function handleEvent(e)
  109.    {
  110.       if(e.vp != undefined && e.vp != this._vc.visibleVideoPlayerIndex)
  111.       {
  112.          return undefined;
  113.       }
  114.       var _loc9_ = this._vc.activeVideoPlayerIndex;
  115.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  116.       if(e.type == "stateChange")
  117.       {
  118.          if(e.state == mx.video.FLVPlayback.BUFFERING)
  119.          {
  120.             if(!this._bufferingOn)
  121.             {
  122.                clearInterval(this._bufferingDelayIntervalID);
  123.                this._bufferingDelayIntervalID = setInterval(this,"doBufferingDelay",this._bufferingDelayInterval);
  124.             }
  125.          }
  126.          else
  127.          {
  128.             clearInterval(this._bufferingDelayIntervalID);
  129.             this._bufferingDelayIntervalID = 0;
  130.             this._bufferingOn = false;
  131.          }
  132.          if(e.state == mx.video.FLVPlayback.LOADING)
  133.          {
  134.             this._progressPercent = !this._vc.getVideoPlayer(e.vp).isRTMP ? 0 : 100;
  135.             var _loc2_ = mx.video.UIManager.SEEK_BAR;
  136.             while(_loc2_ <= mx.video.UIManager.VOLUME_BAR)
  137.             {
  138.                var _loc4_ = this.controls[_loc2_];
  139.                if(_loc4_.progress_mc != undefined)
  140.                {
  141.                   this.positionBar(_loc4_,"progress",this._progressPercent);
  142.                }
  143.                _loc2_ = _loc2_ + 1;
  144.             }
  145.          }
  146.          _loc2_ = 0;
  147.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  148.          {
  149.             if(this.controls[_loc2_] != undefined)
  150.             {
  151.                this.setEnabledAndVisibleForState(_loc2_,e.state);
  152.                if(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  153.                {
  154.                   this.skinButtonControl(this.controls[_loc2_]);
  155.                }
  156.             }
  157.             _loc2_ = _loc2_ + 1;
  158.          }
  159.       }
  160.       else if(e.type == "ready" || e.type == "metadataReceived")
  161.       {
  162.          _loc2_ = 0;
  163.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  164.          {
  165.             if(this.controls[_loc2_] != undefined)
  166.             {
  167.                this.setEnabledAndVisibleForState(_loc2_,this._vc.state);
  168.                if(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  169.                {
  170.                   this.skinButtonControl(this.controls[_loc2_]);
  171.                }
  172.             }
  173.             _loc2_ = _loc2_ + 1;
  174.          }
  175.          if(this._vc.getVideoPlayer(e.vp).isRTMP)
  176.          {
  177.             this._progressPercent = 100;
  178.             _loc2_ = mx.video.UIManager.SEEK_BAR;
  179.             while(_loc2_ <= mx.video.UIManager.VOLUME_BAR)
  180.             {
  181.                _loc4_ = this.controls[_loc2_];
  182.                if(_loc4_.progress_mc != undefined)
  183.                {
  184.                   this.positionBar(_loc4_,"progress",this._progressPercent);
  185.                }
  186.                _loc2_ = _loc2_ + 1;
  187.             }
  188.          }
  189.       }
  190.       else if(e.type == "resize")
  191.       {
  192.          this.layoutSkin();
  193.          this.setupSkinAutoHide();
  194.       }
  195.       else if(e.type == "volumeUpdate")
  196.       {
  197.          if(this._isMuted && e.volume > 0)
  198.          {
  199.             this._isMuted = false;
  200.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_OFF_BUTTON,mx.video.FLVPlayback.PLAYING);
  201.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_OFF_BUTTON]);
  202.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_ON_BUTTON,mx.video.FLVPlayback.PLAYING);
  203.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_ON_BUTTON]);
  204.          }
  205.          var _loc5_ = this.controls[mx.video.UIManager.VOLUME_BAR];
  206.          _loc5_.percentage = !this._isMuted ? e.volume : this.cachedSoundLevel;
  207.          if(_loc5_.percentage < 0)
  208.          {
  209.             _loc5_.percentage = 0;
  210.          }
  211.          else if(_loc5_.percentage > 100)
  212.          {
  213.             _loc5_.percentage = 100;
  214.          }
  215.          this.positionHandle(mx.video.UIManager.VOLUME_BAR);
  216.       }
  217.       else if(e.type == "playheadUpdate" && this.controls[mx.video.UIManager.SEEK_BAR] != undefined)
  218.       {
  219.          if(!this._vc.isLive && this._vc.totalTime > 0)
  220.          {
  221.             var _loc6_ = e.playheadTime / this._vc.totalTime * 100;
  222.             if(_loc6_ < 0)
  223.             {
  224.                _loc6_ = 0;
  225.             }
  226.             else if(_loc6_ > 100)
  227.             {
  228.                _loc6_ = 100;
  229.             }
  230.             var _loc10_ = this.controls[mx.video.UIManager.SEEK_BAR];
  231.             _loc10_.percentage = _loc6_;
  232.             this.positionHandle(mx.video.UIManager.SEEK_BAR);
  233.          }
  234.       }
  235.       else if(e.type == "progress")
  236.       {
  237.          this._progressPercent = e.bytesTotal > 0 ? e.bytesLoaded / e.bytesTotal * 100 : 100;
  238.          var _loc7_ = this._vc._vpState[e.vp].minProgressPercent;
  239.          if(!isNaN(_loc7_) && _loc7_ > this._progressPercent)
  240.          {
  241.             this._progressPercent = _loc7_;
  242.          }
  243.          if(this._vc.totalTime > 0)
  244.          {
  245.             var _loc8_ = this._vc.playheadTime / this._vc.totalTime * 100;
  246.             if(_loc8_ > this._progressPercent)
  247.             {
  248.                this._progressPercent = _loc8_;
  249.                this._vc._vpState[e.vp].minProgressPercent = this._progressPercent;
  250.             }
  251.          }
  252.          _loc2_ = mx.video.UIManager.SEEK_BAR;
  253.          while(_loc2_ <= mx.video.UIManager.VOLUME_BAR)
  254.          {
  255.             _loc4_ = this.controls[_loc2_];
  256.             if(_loc4_.progress_mc != undefined)
  257.             {
  258.                this.positionBar(_loc4_,"progress",this._progressPercent);
  259.             }
  260.             _loc2_ = _loc2_ + 1;
  261.          }
  262.       }
  263.       this._vc.activeVideoPlayerIndex = _loc9_;
  264.    }
  265.    function get bufferingBarHidesAndDisablesOthers()
  266.    {
  267.       return this._bufferingBarHides;
  268.    }
  269.    function set bufferingBarHidesAndDisablesOthers(b)
  270.    {
  271.       this._bufferingBarHides = b;
  272.    }
  273.    function get controlsEnabled()
  274.    {
  275.       return this._controlsEnabled;
  276.    }
  277.    function set controlsEnabled(flag)
  278.    {
  279.       if(this._controlsEnabled == flag)
  280.       {
  281.          return;
  282.       }
  283.       this._controlsEnabled = flag;
  284.       var _loc2_ = 0;
  285.       while(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  286.       {
  287.          if(this.controls[_loc2_] != undefined)
  288.          {
  289.             this.controls[_loc2_].releaseCapture();
  290.             this.controls[_loc2_].enabled = this._controlsEnabled && this.controls[_loc2_].myEnabled;
  291.             this.skinButtonControl(this.controls[_loc2_]);
  292.          }
  293.          _loc2_ = _loc2_ + 1;
  294.       }
  295.    }
  296.    function get skin()
  297.    {
  298.       return this._skin;
  299.    }
  300.    function set skin(s)
  301.    {
  302.       if(s == this._skin)
  303.       {
  304.          return;
  305.       }
  306.       if(this._skin != undefined)
  307.       {
  308.          this.removeSkin();
  309.       }
  310.       this._skin = s;
  311.       this._skinReady = this._skin == undefined || this._skin == null || this._skin == "";
  312.       if(!this._skinReady)
  313.       {
  314.          this.downloadSkin();
  315.       }
  316.    }
  317.    function get skinAutoHide()
  318.    {
  319.       return this._skinAutoHide;
  320.    }
  321.    function set skinAutoHide(b)
  322.    {
  323.       if(b == this._skinAutoHide)
  324.       {
  325.          return;
  326.       }
  327.       this._skinAutoHide = b;
  328.       this.setupSkinAutoHide();
  329.    }
  330.    function get skinReady()
  331.    {
  332.       return this._skinReady;
  333.    }
  334.    function get seekBarInterval()
  335.    {
  336.       return this._seekBarInterval;
  337.    }
  338.    function set seekBarInterval(s)
  339.    {
  340.       if(this._seekBarInterval == s)
  341.       {
  342.          return;
  343.       }
  344.       this._seekBarInterval = s;
  345.       if(this._seekBarIntervalID > 0)
  346.       {
  347.          clearInterval(this._seekBarIntervalID);
  348.          this._seekBarIntervalID = setInterval(this,"seekBarListener",this._seekBarInterval,false);
  349.       }
  350.    }
  351.    function get volumeBarInterval()
  352.    {
  353.       return this._volumeBarInterval;
  354.    }
  355.    function set volumeBarInterval(s)
  356.    {
  357.       if(this._volumeBarInterval == s)
  358.       {
  359.          return;
  360.       }
  361.       this._volumeBarInterval = s;
  362.       if(this._volumeBarIntervalID > 0)
  363.       {
  364.          clearInterval(this._volumeBarIntervalID);
  365.          this._volumeBarIntervalID = setInterval(this,"volumeBarListener",this._volumeBarInterval,false);
  366.       }
  367.    }
  368.    function get bufferingDelayInterval()
  369.    {
  370.       return this._bufferingDelayInterval;
  371.    }
  372.    function set bufferingDelayInterval(s)
  373.    {
  374.       if(this._bufferingDelayInterval == s)
  375.       {
  376.          return;
  377.       }
  378.       this._bufferingDelayInterval = s;
  379.       if(this._bufferingDelayIntervalID > 0)
  380.       {
  381.          clearInterval(this._bufferingDelayIntervalID);
  382.          this._bufferingDelayIntervalID = setInterval(this,"doBufferingDelay",this._bufferingDelayIntervalID);
  383.       }
  384.    }
  385.    function get volumeBarScrubTolerance()
  386.    {
  387.       return this._volumeBarScrubTolerance;
  388.    }
  389.    function set volumeBarScrubTolerance(s)
  390.    {
  391.       this._volumeBarScrubTolerance = s;
  392.    }
  393.    function get seekBarScrubTolerance()
  394.    {
  395.       return this._seekBarScrubTolerance;
  396.    }
  397.    function set seekBarScrubTolerance(s)
  398.    {
  399.       this._seekBarScrubTolerance = s;
  400.    }
  401.    function get visible()
  402.    {
  403.       return this.__visible;
  404.    }
  405.    function set visible(v)
  406.    {
  407.       if(this.__visible == v)
  408.       {
  409.          return;
  410.       }
  411.       this.__visible = v;
  412.       if(!this.__visible)
  413.       {
  414.          this.skin_mc._visible = false;
  415.       }
  416.       else
  417.       {
  418.          this.setupSkinAutoHide();
  419.       }
  420.    }
  421.    function getControl(index)
  422.    {
  423.       return this.controls[index];
  424.    }
  425.    function setControl(index, s)
  426.    {
  427.       if(s == null)
  428.       {
  429.          s = undefined;
  430.       }
  431.       if(s == this.controls[index])
  432.       {
  433.          return undefined;
  434.       }
  435.       switch(index)
  436.       {
  437.          case mx.video.UIManager.PAUSE_BUTTON:
  438.          case mx.video.UIManager.PLAY_BUTTON:
  439.             this.resetPlayPause();
  440.             break;
  441.          case mx.video.UIManager.PLAY_PAUSE_BUTTON:
  442.             if(s._parent != this.layout_mc)
  443.             {
  444.                this.resetPlayPause();
  445.                this.setControl(mx.video.UIManager.PAUSE_BUTTON,s.pause_mc);
  446.                this.setControl(mx.video.UIManager.PLAY_BUTTON,s.play_mc);
  447.             }
  448.             break;
  449.          case mx.video.UIManager.MUTE_BUTTON:
  450.             if(s._parent != this.layout_mc)
  451.             {
  452.                this.setControl(mx.video.UIManager.MUTE_ON_BUTTON,s.on_mc);
  453.                this.setControl(mx.video.UIManager.MUTE_OFF_BUTTON,s.off_mc);
  454.             }
  455.       }
  456.       if(index >= mx.video.UIManager.NUM_BUTTONS)
  457.       {
  458.          this.controls[index] = s;
  459.          switch(index)
  460.          {
  461.             case mx.video.UIManager.SEEK_BAR:
  462.                this.addBarControl(mx.video.UIManager.SEEK_BAR);
  463.                break;
  464.             case mx.video.UIManager.VOLUME_BAR:
  465.                this.addBarControl(mx.video.UIManager.VOLUME_BAR);
  466.                this.controls[mx.video.UIManager.VOLUME_BAR].percentage = this._vc.volume;
  467.                break;
  468.             case mx.video.UIManager.BUFFERING_BAR:
  469.                this.controls[mx.video.UIManager.BUFFERING_BAR].uiMgr = this;
  470.                this.controls[mx.video.UIManager.BUFFERING_BAR].controlIndex = mx.video.UIManager.BUFFERING_BAR;
  471.                if(this.controls[mx.video.UIManager.BUFFERING_BAR]._parent == this.skin_mc)
  472.                {
  473.                   this.finishAddBufferingBar();
  474.                }
  475.                else
  476.                {
  477.                   this.controls[mx.video.UIManager.BUFFERING_BAR].onEnterFrame = function()
  478.                   {
  479.                      this.uiMgr.finishAddBufferingBar();
  480.                   };
  481.                }
  482.          }
  483.          this.setEnabledAndVisibleForState(index,this._vc.state);
  484.       }
  485.       else
  486.       {
  487.          this.removeButtonControl(index);
  488.          this.controls[index] = s;
  489.          this.addButtonControl(index);
  490.       }
  491.    }
  492.    function resetPlayPause()
  493.    {
  494.       if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] == undefined)
  495.       {
  496.          return undefined;
  497.       }
  498.       var _loc2_ = mx.video.UIManager.PAUSE_BUTTON;
  499.       while(_loc2_ <= mx.video.UIManager.PLAY_BUTTON)
  500.       {
  501.          this.removeButtonControl(_loc2_);
  502.          _loc2_ = _loc2_ + 1;
  503.       }
  504.       this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] = undefined;
  505.    }
  506.    function addButtonControl(index)
  507.    {
  508.       var _loc3_ = this.controls[index];
  509.       if(_loc3_ == undefined)
  510.       {
  511.          return undefined;
  512.       }
  513.       var _loc5_ = this._vc.activeVideoPlayerIndex;
  514.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  515.       _loc3_.id = index;
  516.       _loc3_.state = mx.video.UIManager.UP_STATE;
  517.       _loc3_.uiMgr = this;
  518.       this.setEnabledAndVisibleForState(index,this._vc.state);
  519.       _loc3_.onRollOver = function()
  520.       {
  521.          this.state = mx.video.UIManager.OVER_STATE;
  522.          this.uiMgr.skinButtonControl(this);
  523.       };
  524.       _loc3_.onRollOut = function()
  525.       {
  526.          this.state = mx.video.UIManager.UP_STATE;
  527.          this.uiMgr.skinButtonControl(this);
  528.       };
  529.       if(index == mx.video.UIManager.SEEK_BAR_HANDLE || index == mx.video.UIManager.VOLUME_BAR_HANDLE)
  530.       {
  531.          _loc3_.onPress = function()
  532.          {
  533.             if(_root.focusManager)
  534.             {
  535.                this._focusrect = false;
  536.                Selection.setFocus(this);
  537.             }
  538.             this.state = mx.video.UIManager.DOWN_STATE;
  539.             this.uiMgr.dispatchMessage(this);
  540.             this.uiMgr.skinButtonControl(this);
  541.          };
  542.          _loc3_.onRelease = function()
  543.          {
  544.             this.state = mx.video.UIManager.OVER_STATE;
  545.             this.uiMgr.handleRelease(this.controlIndex);
  546.             this.uiMgr.skinButtonControl(this);
  547.          };
  548.          _loc3_.onReleaseOutside = function()
  549.          {
  550.             this.state = mx.video.UIManager.UP_STATE;
  551.             this.uiMgr.handleRelease(this.controlIndex);
  552.             this.uiMgr.skinButtonControl(this);
  553.          };
  554.       }
  555.       else
  556.       {
  557.          _loc3_.onPress = function()
  558.          {
  559.             if(_root.focusManager)
  560.             {
  561.                this._focusrect = false;
  562.                Selection.setFocus(this);
  563.             }
  564.             this.state = mx.video.UIManager.DOWN_STATE;
  565.             this.uiMgr.skinButtonControl(this);
  566.          };
  567.          _loc3_.onRelease = function()
  568.          {
  569.             this.state = mx.video.UIManager.OVER_STATE;
  570.             this.uiMgr.dispatchMessage(this);
  571.             this.uiMgr.skinButtonControl(this);
  572.          };
  573.          _loc3_.onReleaseOutside = function()
  574.          {
  575.             this.state = mx.video.UIManager.UP_STATE;
  576.             this.uiMgr.skinButtonControl(this);
  577.          };
  578.       }
  579.       if(_loc3_._parent == this.skin_mc)
  580.       {
  581.          this.skinButtonControl(_loc3_);
  582.       }
  583.       else
  584.       {
  585.          _loc3_.onEnterFrame = function()
  586.          {
  587.             this.uiMgr.skinButtonControl(this);
  588.          };
  589.       }
  590.       this._vc.activeVideoPlayerIndex = _loc5_;
  591.    }
  592.    function removeButtonControl(index)
  593.    {
  594.       if(this.controls[index] == undefined)
  595.       {
  596.          return undefined;
  597.       }
  598.       this.controls[index].uiMgr = undefined;
  599.       this.controls[index].onRollOver = undefined;
  600.       this.controls[index].onRollOut = undefined;
  601.       this.controls[index].onPress = undefined;
  602.       this.controls[index].onRelease = undefined;
  603.       this.controls[index].onReleaseOutside = undefined;
  604.       this.controls[index] = undefined;
  605.    }
  606.    function downloadSkin()
  607.    {
  608.       if(this.skinLoader == undefined)
  609.       {
  610.          this.skinLoader = new MovieClipLoader();
  611.          this.skinLoader.addListener(this);
  612.       }
  613.       if(this.skin_mc == undefined)
  614.       {
  615.          this.skin_mc = this._vc.createEmptyMovieClip("skin_mc",this._vc.getNextHighestDepth());
  616.       }
  617.       this.skin_mc._visible = false;
  618.       this.skin_mc._x = Stage.width + 100;
  619.       this.skin_mc._y = Stage.height + 100;
  620.       this.skinLoader.loadClip(this._skin,this.skin_mc);
  621.    }
  622.    function onLoadError(target_mc, errorCode)
  623.    {
  624.       this._skinReady = true;
  625.       this._vc.skinError("Unable to load skin swf");
  626.    }
  627.    function onLoadInit()
  628.    {
  629.       try
  630.       {
  631.          this.skin_mc._visible = false;
  632.          this.skin_mc._x = 0;
  633.          this.skin_mc._y = 0;
  634.          this.layout_mc = this.skin_mc.layout_mc;
  635.          if(this.layout_mc == undefined)
  636.          {
  637.             throw new Error("No layout_mc");
  638.          }
  639.          this.layout_mc._visible = false;
  640.          this.customClips = new Array();
  641.          this.setCustomClips("bg");
  642.          if(this.layout_mc.playpause_mc != undefined)
  643.          {
  644.             this.setSkin(mx.video.UIManager.PLAY_PAUSE_BUTTON,this.layout_mc.playpause_mc);
  645.          }
  646.          else
  647.          {
  648.             this.setSkin(mx.video.UIManager.PAUSE_BUTTON,this.layout_mc.pause_mc);
  649.             this.setSkin(mx.video.UIManager.PLAY_BUTTON,this.layout_mc.play_mc);
  650.          }
  651.          this.setSkin(mx.video.UIManager.STOP_BUTTON,this.layout_mc.stop_mc);
  652.          this.setSkin(mx.video.UIManager.BACK_BUTTON,this.layout_mc.back_mc);
  653.          this.setSkin(mx.video.UIManager.FORWARD_BUTTON,this.layout_mc.forward_mc);
  654.          this.setSkin(mx.video.UIManager.MUTE_BUTTON,this.layout_mc.volumeMute_mc);
  655.          this.setSkin(mx.video.UIManager.SEEK_BAR,this.layout_mc.seekBar_mc);
  656.          this.setSkin(mx.video.UIManager.VOLUME_BAR,this.layout_mc.volumeBar_mc);
  657.          this.setSkin(mx.video.UIManager.BUFFERING_BAR,this.layout_mc.bufferingBar_mc);
  658.          this.setCustomClips("fg");
  659.          this.layoutSkin();
  660.          this.setupSkinAutoHide();
  661.          this.skin_mc._visible = this.__visible;
  662.          this._skinReady = true;
  663.          this._vc.skinLoaded();
  664.          var _loc4_ = this._vc.activeVideoPlayerIndex;
  665.          this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  666.          var _loc3_ = this._vc.state;
  667.          var _loc2_ = 0;
  668.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  669.          {
  670.             if(this.controls[_loc2_] != undefined)
  671.             {
  672.                this.setEnabledAndVisibleForState(_loc2_,_loc3_);
  673.                if(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  674.                {
  675.                   this.skinButtonControl(this.controls[_loc2_]);
  676.                }
  677.             }
  678.             _loc2_ = _loc2_ + 1;
  679.          }
  680.          this._vc.activeVideoPlayerIndex = _loc4_;
  681.       }
  682.       catch(err:Error)
  683.       {
  684.          this._vc.skinError(err.message);
  685.          this.removeSkin();
  686.       }
  687.    }
  688.    function layoutSkin()
  689.    {
  690.       if(this.layout_mc == undefined)
  691.       {
  692.          return undefined;
  693.       }
  694.       var _loc3_ = this.layout_mc.video_mc;
  695.       if(_loc3_ == undefined)
  696.       {
  697.          throw new Error("No layout_mc.video_mc");
  698.       }
  699.       this.placeholderLeft = _loc3_._x;
  700.       this.placeholderRight = _loc3_._x + _loc3_._width;
  701.       this.placeholderTop = _loc3_._y;
  702.       this.placeholderBottom = _loc3_._y + _loc3_._height;
  703.       this.videoLeft = 0;
  704.       this.videoRight = this._vc.width;
  705.       this.videoTop = 0;
  706.       this.videoBottom = this._vc.height;
  707.       if(!isNaN(this.layout_mc.minWidth) && this.layout_mc.minWidth > 0 && this.layout_mc.minWidth > this.videoRight)
  708.       {
  709.          this.videoLeft -= (this.layout_mc.minWidth - this.videoRight) / 2;
  710.          this.videoRight = this.layout_mc.minWidth + this.videoLeft;
  711.       }
  712.       if(!isNaN(this.layout_mc.minHeight) && this.layout_mc.minHeight > 0 && this.layout_mc.minHeight > this.videoBottom)
  713.       {
  714.          this.videoTop -= (this.layout_mc.minHeight - this.videoBottom) / 2;
  715.          this.videoBottom = this.layout_mc.minHeight + this.videoTop;
  716.       }
  717.       var _loc2_ = undefined;
  718.       _loc2_ = 0;
  719.       while(_loc2_ < this.customClips.length)
  720.       {
  721.          this.layoutControl(this.customClips[_loc2_]);
  722.          _loc2_ = _loc2_ + 1;
  723.       }
  724.       _loc2_ = 0;
  725.       while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  726.       {
  727.          this.layoutControl(this.controls[_loc2_]);
  728.          _loc2_ = _loc2_ + 1;
  729.       }
  730.    }
  731.    function layoutControl(ctrl)
  732.    {
  733.       if(ctrl == undefined)
  734.       {
  735.          return undefined;
  736.       }
  737.       if(ctrl.skin.anchorRight)
  738.       {
  739.          if(ctrl.skin.anchorLeft)
  740.          {
  741.             ctrl._x = ctrl.skin._x - this.placeholderLeft + this.videoLeft;
  742.             ctrl._width = ctrl.skin._x + ctrl.skin._width - this.placeholderRight + this.videoRight - ctrl._x;
  743.             if(ctrl.origWidth != undefined)
  744.             {
  745.                ctrl.origWidth = undefined;
  746.             }
  747.          }
  748.          else
  749.          {
  750.             ctrl._x = ctrl.skin._x - this.placeholderRight + this.videoRight;
  751.          }
  752.       }
  753.       else
  754.       {
  755.          ctrl._x = ctrl.skin._x - this.placeholderLeft + this.videoLeft;
  756.       }
  757.       if(ctrl.skin.anchorTop)
  758.       {
  759.          if(ctrl.skin.anchorBottom)
  760.          {
  761.             ctrl._y = ctrl.skin._y - this.placeholderTop + this.videoTop;
  762.             ctrl._height = ctrl.skin._y + ctrl.skin._height - this.placeholderBottom + this.videoBottom - ctrl._y;
  763.             if(ctrl.origHeight != undefined)
  764.             {
  765.                ctrl.origHeight = undefined;
  766.             }
  767.          }
  768.          else
  769.          {
  770.             ctrl._y = ctrl.skin._y - this.placeholderTop + this.videoTop;
  771.          }
  772.       }
  773.       else
  774.       {
  775.          ctrl._y = ctrl.skin._y - this.placeholderBottom + this.videoBottom;
  776.       }
  777.       switch(ctrl.controlIndex)
  778.       {
  779.          case mx.video.UIManager.SEEK_BAR:
  780.          case mx.video.UIManager.VOLUME_BAR:
  781.             if(ctrl.progress_mc != undefined)
  782.             {
  783.                if(this._progressPercent == undefined)
  784.                {
  785.                   this._progressPercent = !this._vc.isRTMP ? 0 : 100;
  786.                }
  787.                this.positionBar(ctrl,"progress",this._progressPercent);
  788.             }
  789.             this.positionHandle(ctrl.controlIndex);
  790.             break;
  791.          case mx.video.UIManager.BUFFERING_BAR:
  792.             if(ctrl.fill_mc != undefined)
  793.             {
  794.                this.positionMaskedFill(ctrl,ctrl.fill_mc,100);
  795.             }
  796.       }
  797.       if(ctrl.layoutSelf != undefined)
  798.       {
  799.          ctrl.layoutSelf();
  800.       }
  801.    }
  802.    function removeSkin()
  803.    {
  804.       if(this.skin_mc != undefined)
  805.       {
  806.          var _loc2_ = 0;
  807.          while(_loc2_ < mx.video.UIManager.NUM_BUTTONS)
  808.          {
  809.             this.removeButtonControl(_loc2_);
  810.             _loc2_ = _loc2_ + 1;
  811.          }
  812.          _loc2_ = mx.video.UIManager.NUM_BUTTONS;
  813.          while(_loc2_ < mx.video.UIManager.NUM_CONTROLS)
  814.          {
  815.             this.controls[_loc2_] = undefined;
  816.             _loc2_ = _loc2_ + 1;
  817.          }
  818.          this.skin_mc.unloadMovie();
  819.          this.layout_mc = undefined;
  820.          this.border_mc = undefined;
  821.       }
  822.    }
  823.    function setCustomClips(prefix)
  824.    {
  825.       var _loc4_ = 1;
  826.       while(true)
  827.       {
  828.          var _loc2_ = this.layout_mc[prefix + _loc4_++ + "_mc"];
  829.          if(_loc2_ == undefined)
  830.          {
  831.             break;
  832.          }
  833.          var _loc3_ = _loc2_.mc;
  834.          if(_loc3_ == undefined)
  835.          {
  836.             _loc3_ = _loc2_._parent._parent[_loc2_._name];
  837.          }
  838.          if(_loc3_ == undefined)
  839.          {
  840.             throw new Error("Bad clip in skin: " + _loc2_);
  841.          }
  842.          _loc3_.skin = _loc2_;
  843.          this.customClips.push(_loc3_);
  844.          if(prefix == "bg" && _loc4_ == 2)
  845.          {
  846.             this.border_mc = _loc3_;
  847.          }
  848.       }
  849.    }
  850.    function setSkin(index, s)
  851.    {
  852.       if(s == undefined)
  853.       {
  854.          return undefined;
  855.       }
  856.       var _loc2_ = s.mc;
  857.       if(_loc2_ == undefined)
  858.       {
  859.          _loc2_ = s._parent._parent[s._name];
  860.       }
  861.       if(_loc2_ == undefined)
  862.       {
  863.          throw new Error("Bad clip in skin: " + s);
  864.       }
  865.       _loc2_.skin = s;
  866.       if(index < mx.video.UIManager.NUM_BUTTONS)
  867.       {
  868.          this.setupSkinStates(_loc2_);
  869.       }
  870.       else
  871.       {
  872.          switch(index)
  873.          {
  874.             case mx.video.UIManager.PLAY_PAUSE_BUTTON:
  875.                this.setupSkinStates(_loc2_.play_mc);
  876.                this.setupSkinStates(_loc2_.pause_mc);
  877.                break;
  878.             case mx.video.UIManager.MUTE_BUTTON:
  879.                this.setupSkinStates(_loc2_.on_mc);
  880.                this.setupSkinStates(_loc2_.off_mc);
  881.                break;
  882.             case mx.video.UIManager.SEEK_BAR:
  883.             case mx.video.UIManager.VOLUME_BAR:
  884.                var _loc4_ = index != mx.video.UIManager.SEEK_BAR ? "volumeBar" : "seekBar";
  885.                if(_loc2_.handle_mc == undefined)
  886.                {
  887.                   _loc2_.handle_mc = _loc2_.skin.seekBarHandle_mc;
  888.                   if(_loc2_.handle_mc == undefined)
  889.                   {
  890.                      _loc2_.handle_mc = _loc2_.skin._parent._parent[_loc4_ + "Handle_mc"];
  891.                   }
  892.                }
  893.                if(_loc2_.progress_mc == undefined)
  894.                {
  895.                   _loc2_.progress_mc = _loc2_.skin.progress_mc;
  896.                   if(_loc2_.progress_mc == undefined)
  897.                   {
  898.                      _loc2_.progress_mc = _loc2_.skin._parent._parent[_loc4_ + "Progress_mc"];
  899.                   }
  900.                }
  901.                if(_loc2_.fullness_mc == undefined)
  902.                {
  903.                   _loc2_.fullness_mc = _loc2_.skin.fullness_mc;
  904.                   if(_loc2_.fullness_mc == undefined)
  905.                   {
  906.                      _loc2_.fullness_mc = _loc2_.skin._parent._parent[_loc4_ + "Fullness_mc"];
  907.                   }
  908.                }
  909.                break;
  910.             case mx.video.UIManager.BUFFERING_BAR:
  911.                if(_loc2_.fill_mc == undefined)
  912.                {
  913.                   _loc2_.fill_mc = _loc2_.skin.fill_mc;
  914.                   if(_loc2_.fill_mc == undefined)
  915.                   {
  916.                      _loc2_.fill_mc = _loc2_.skin._parent._parent.bufferingBarFill_mc;
  917.                   }
  918.                }
  919.          }
  920.       }
  921.       this.setControl(index,_loc2_);
  922.    }
  923.    function setupSkinStates(ctrl)
  924.    {
  925.       if(ctrl.up_mc == undefined)
  926.       {
  927.          ctrl.up_mc = ctrl;
  928.          ctrl.over_mc = ctrl;
  929.          ctrl.down_mc = ctrl;
  930.          ctrl.disabled_mc = ctrl;
  931.       }
  932.       else
  933.       {
  934.          ctrl._x = 0;
  935.          ctrl._y = 0;
  936.          ctrl.up_mc._x = 0;
  937.          ctrl.up_mc._y = 0;
  938.          ctrl.up_mc._visible = true;
  939.          if(ctrl.over_mc == undefined)
  940.          {
  941.             ctrl.over_mc = ctrl.up_mc;
  942.          }
  943.          else
  944.          {
  945.             ctrl.over_mc._x = 0;
  946.             ctrl.over_mc._y = 0;
  947.             ctrl.over_mc._visible = false;
  948.          }
  949.          if(ctrl.down_mc == undefined)
  950.          {
  951.             ctrl.down_mc = ctrl.up_mc;
  952.          }
  953.          else
  954.          {
  955.             ctrl.down_mc._x = 0;
  956.             ctrl.down_mc._y = 0;
  957.             ctrl.down_mc._visible = false;
  958.          }
  959.          if(ctrl.disabled_mc == undefined)
  960.          {
  961.             ctrl.disabled_mc_mc = ctrl.up_mc;
  962.          }
  963.          else
  964.          {
  965.             ctrl.disabled_mc._x = 0;
  966.             ctrl.disabled_mc._y = 0;
  967.             ctrl.disabled_mc._visible = false;
  968.          }
  969.       }
  970.    }
  971.    function skinButtonControl(ctrl)
  972.    {
  973.       if(ctrl.onEnterFrame != undefined)
  974.       {
  975.          delete ctrl.onEnterFrame;
  976.          ctrl.onEnterFrame = undefined;
  977.       }
  978.       if(ctrl.enabled)
  979.       {
  980.          switch(ctrl.state)
  981.          {
  982.             case mx.video.UIManager.UP_STATE:
  983.                if(ctrl.up_mc == undefined)
  984.                {
  985.                   ctrl.up_mc = ctrl.attachMovie(ctrl.upLinkageID,"up_mc",ctrl.getNextHighestDepth());
  986.                }
  987.                this.applySkinState(ctrl,ctrl.up_mc);
  988.                break;
  989.             case mx.video.UIManager.OVER_STATE:
  990.                if(ctrl.over_mc == undefined)
  991.                {
  992.                   if(ctrl.overLinkageID == undefined)
  993.                   {
  994.                      ctrl.over_mc = ctrl.up_mc;
  995.                   }
  996.                   else
  997.                   {
  998.                      ctrl.over_mc = ctrl.attachMovie(ctrl.overLinkageID,"over_mc",ctrl.getNextHighestDepth());
  999.                   }
  1000.                }
  1001.                this.applySkinState(ctrl,ctrl.over_mc);
  1002.                break;
  1003.             case mx.video.UIManager.DOWN_STATE:
  1004.                if(ctrl.down_mc == undefined)
  1005.                {
  1006.                   if(ctrl.downLinkageID == undefined)
  1007.                   {
  1008.                      ctrl.down_mc = ctrl.up_mc;
  1009.                   }
  1010.                   else
  1011.                   {
  1012.                      ctrl.down_mc = ctrl.attachMovie(ctrl.downLinkageID,"down_mc",ctrl.getNextHighestDepth());
  1013.                   }
  1014.                }
  1015.                this.applySkinState(ctrl,ctrl.down_mc);
  1016.          }
  1017.       }
  1018.       else
  1019.       {
  1020.          ctrl.state = mx.video.UIManager.UP_STATE;
  1021.          if(ctrl.disabled_mc == undefined)
  1022.          {
  1023.             if(ctrl.disabledLinkageID == undefined)
  1024.             {
  1025.                ctrl.disabled_mc = ctrl.up_mc;
  1026.             }
  1027.             else
  1028.             {
  1029.                ctrl.disabled_mc = ctrl.attachMovie(ctrl.disabledLinkageID,"disabled_mc",ctrl.getNextHighestDepth());
  1030.             }
  1031.          }
  1032.          this.applySkinState(ctrl,ctrl.disabled_mc);
  1033.       }
  1034.       if(ctrl.placeholder_mc != undefined)
  1035.       {
  1036.          ctrl.placeholder_mc.unloadMovie();
  1037.          delete ctrl.placeholder_mc;
  1038.          ctrl.placeholder_mc = undefined;
  1039.       }
  1040.    }
  1041.    function applySkinState(ctrl, state)
  1042.    {
  1043.       if(state != ctrl.currentState_mc)
  1044.       {
  1045.          if(state != undefined)
  1046.          {
  1047.             state._visible = true;
  1048.          }
  1049.          if(ctrl.currentState_mc != undefined)
  1050.          {
  1051.             ctrl.currentState_mc._visible = false;
  1052.          }
  1053.          ctrl.currentState_mc = state;
  1054.       }
  1055.    }
  1056.    function addBarControl(controlIndex)
  1057.    {
  1058.       var _loc2_ = this.controls[controlIndex];
  1059.       _loc2_.isDragging = false;
  1060.       _loc2_.percentage = 0;
  1061.       _loc2_.uiMgr = this;
  1062.       _loc2_.controlIndex = controlIndex;
  1063.       if(_loc2_._parent == this.skin_mc)
  1064.       {
  1065.          this.finishAddBarControl(controlIndex);
  1066.       }
  1067.       else
  1068.       {
  1069.          _loc2_.onEnterFrame = function()
  1070.          {
  1071.             this.uiMgr.finishAddBarControl(this.controlIndex);
  1072.          };
  1073.       }
  1074.    }
  1075.    function finishAddBarControl(controlIndex)
  1076.    {
  1077.       var _loc2_ = this.controls[controlIndex];
  1078.       delete _loc2_.onEnterFrame;
  1079.       _loc2_.onEnterFrame = undefined;
  1080.       if(_loc2_.addBarControl != undefined)
  1081.       {
  1082.          _loc2_.addBarControl();
  1083.       }
  1084.       this.calcBarMargins(_loc2_,"handle",true);
  1085.       this.calcBarMargins(_loc2_,"progress",false);
  1086.       this.calcBarMargins(_loc2_.progress_mc,"fill",false);
  1087.       this.calcBarMargins(_loc2_.progress_mc,"mask",false);
  1088.       this.calcBarMargins(_loc2_,"fullness",false);
  1089.       this.calcBarMargins(_loc2_.fullness_mc,"fill",false);
  1090.       this.calcBarMargins(_loc2_.fullness_mc,"mask",false);
  1091.       _loc2_.origWidth = _loc2_._width;
  1092.       _loc2_.origHeight = _loc2_._height;
  1093.       this.fixUpBar(_loc2_,"progress");
  1094.       if(_loc2_.progress_mc != undefined)
  1095.       {
  1096.          this.fixUpBar(_loc2_,"progressBarFill");
  1097.          if(this._progressPercent == undefined)
  1098.          {
  1099.             this._progressPercent = !this._vc.isRTMP ? 0 : 100;
  1100.          }
  1101.          this.positionBar(_loc2_,"progress",this._progressPercent);
  1102.       }
  1103.       this.fixUpBar(_loc2_,"fullness");
  1104.       if(_loc2_.fullness_mc != undefined)
  1105.       {
  1106.          this.fixUpBar(_loc2_,"fullnessBarFill");
  1107.       }
  1108.       this.fixUpBar(_loc2_,"handle");
  1109.       _loc2_.handle_mc.controlIndex = controlIndex;
  1110.       switch(controlIndex)
  1111.       {
  1112.          case mx.video.UIManager.SEEK_BAR:
  1113.             this.setControl(mx.video.UIManager.SEEK_BAR_HANDLE,_loc2_.handle_mc);
  1114.             break;
  1115.          case mx.video.UIManager.VOLUME_BAR:
  1116.             this.setControl(mx.video.UIManager.VOLUME_BAR_HANDLE,_loc2_.handle_mc);
  1117.       }
  1118.       this.positionHandle(controlIndex);
  1119.    }
  1120.    function fixUpBar(ctrl, type)
  1121.    {
  1122.       if(ctrl[type + "LinkageID"] != undefined && ctrl[type + "LinkageID"].length > 0)
  1123.       {
  1124.          var _loc1_ = undefined;
  1125.          if(ctrl[type + "Below"])
  1126.          {
  1127.             _loc1_ = -1;
  1128.             while(ctrl._parent.getInstanceAtDepth(_loc1_) != undefined)
  1129.             {
  1130.                _loc1_ = _loc1_ - 1;
  1131.             }
  1132.          }
  1133.          else
  1134.          {
  1135.             ctrl[type + "Below"] = false;
  1136.             _loc1_ = ctrl._parent.getNextHighestDepth();
  1137.          }
  1138.          var _loc5_ = ctrl.controlIndex != mx.video.UIManager.SEEK_BAR ? "volumeBar" : "seekBar";
  1139.          var _loc4_ = _loc5_ + type.substring(0,1).toUpperCase() + type.substring(1) + "_mc";
  1140.          ctrl[type + "_mc"] = ctrl._parent.attachMovie(ctrl[type + "LinkageID"],_loc4_,_loc1_);
  1141.       }
  1142.    }
  1143.    function calcBarMargins(ctrl, type, symmetricMargins)
  1144.    {
  1145.       var _loc2_ = ctrl[type + "_mc"];
  1146.       if(_loc2_ == undefined)
  1147.       {
  1148.          return undefined;
  1149.       }
  1150.       if(ctrl[type + "LeftMargin"] == undefined && _loc2_._parent == ctrl._parent)
  1151.       {
  1152.          ctrl[type + "LeftMargin"] = _loc2_._x - ctrl._x;
  1153.       }
  1154.       if(ctrl[type + "RightMargin"] == undefined)
  1155.       {
  1156.          if(symmetricMargins)
  1157.          {
  1158.             ctrl[type + "RightMargin"] = ctrl[type + "LeftMargin"];
  1159.          }
  1160.          else if(_loc2_._parent == ctrl._parent)
  1161.          {
  1162.             ctrl[type + "RightMargin"] = ctrl._width - _loc2_._width - _loc2_._x + ctrl._x;
  1163.          }
  1164.       }
  1165.       if(ctrl[type + "TopMargin"] == undefined && _loc2_._parent == ctrl._parent)
  1166.       {
  1167.          ctrl[type + "TopMargin"] = _loc2_._y - ctrl._y;
  1168.       }
  1169.       if(ctrl[type + "BottomMargin"] == undefined)
  1170.       {
  1171.          if(symmetricMargins)
  1172.          {
  1173.             ctrl[type + "BottomMargin"] = ctrl[type + "TopMargin"];
  1174.          }
  1175.          else if(_loc2_._parent == ctrl._parent)
  1176.          {
  1177.             ctrl[type + "BottomMargin"] = ctrl._height - _loc2_._height - _loc2_._y + ctrl._y;
  1178.          }
  1179.       }
  1180.       if(ctrl[type + "X"] == undefined)
  1181.       {
  1182.          if(_loc2_._parent == ctrl._parent)
  1183.          {
  1184.             ctrl[type + "X"] = _loc2_._x - ctrl._x;
  1185.          }
  1186.          else if(_loc2_._parent == ctrl)
  1187.          {
  1188.             ctrl[type + "X"] = _loc2_._x;
  1189.          }
  1190.       }
  1191.       if(ctrl[type + "Y"] == undefined)
  1192.       {
  1193.          if(_loc2_._parent == ctrl._parent)
  1194.          {
  1195.             ctrl[type + "Y"] = _loc2_._y - ctrl._y;
  1196.          }
  1197.          else if(_loc2_._parent == ctrl)
  1198.          {
  1199.             ctrl[type + "Y"] = _loc2_._y;
  1200.          }
  1201.       }
  1202.       ctrl[type + "XScale"] = _loc2_._xscale;
  1203.       ctrl[type + "YScale"] = _loc2_._yscale;
  1204.       ctrl[type + "Width"] = _loc2_._width;
  1205.       ctrl[type + "Height"] = _loc2_._height;
  1206.    }
  1207.    function finishAddBufferingBar()
  1208.    {
  1209.       var _loc2_ = this.controls[mx.video.UIManager.BUFFERING_BAR];
  1210.       delete _loc2_.onEnterFrame;
  1211.       _loc2_.onEnterFrame = undefined;
  1212.       this.calcBarMargins(_loc2_,"fill",true);
  1213.       this.fixUpBar(_loc2_,"fill");
  1214.       if(_loc2_.fill_mc != undefined)
  1215.       {
  1216.          this.positionMaskedFill(_loc2_,_loc2_.fill_mc,100);
  1217.       }
  1218.    }
  1219.    function positionMaskedFill(ctrl, fill, percent)
  1220.    {
  1221.       var _loc5_ = fill._parent;
  1222.       var _loc3_ = ctrl.mask_mc;
  1223.       if(_loc3_ == undefined)
  1224.       {
  1225.          _loc3_ = _loc5_.createEmptyMovieClip(ctrl._name + "Mask_mc",_loc5_.getNextHighestDepth());
  1226.          ctrl.mask_mc = _loc3_;
  1227.          _loc3_.beginFill(16777215);
  1228.          _loc3_.lineTo(0,0);
  1229.          _loc3_.lineTo(1,0);
  1230.          _loc3_.lineTo(1,1);
  1231.          _loc3_.lineTo(0,1);
  1232.          _loc3_.lineTo(0,0);
  1233.          _loc3_.endFill();
  1234.          fill.setMask(_loc3_);
  1235.          _loc3_._x = ctrl.fillX;
  1236.          _loc3_._y = ctrl.fillY;
  1237.          _loc3_._width = ctrl.fillWidth;
  1238.          _loc3_._height = ctrl.fillHeight;
  1239.          _loc3_._visible = false;
  1240.          this.calcBarMargins(ctrl,"mask",true);
  1241.       }
  1242.       if(_loc5_ == ctrl)
  1243.       {
  1244.          if(fill.slideReveal)
  1245.          {
  1246.             fill._x = ctrl.maskX - ctrl.fillWidth + ctrl.fillWidth * percent / 100;
  1247.          }
  1248.          else
  1249.          {
  1250.             _loc3_._width = ctrl.fillWidth * percent / 100;
  1251.          }
  1252.       }
  1253.       else if(_loc5_ == ctrl._parent)
  1254.       {
  1255.          if(fill.slideReveal)
  1256.          {
  1257.             _loc3_._x = ctrl._x + ctrl.maskLeftMargin;
  1258.             _loc3_._y = ctrl._y + ctrl.maskTopMargin;
  1259.             _loc3_._width = ctrl._width - ctrl.maskRightMargin - ctrl.maskLeftMargin;
  1260.             _loc3_._height = ctrl._height - ctrl.maskTopMargin - ctrl.maskBottomMargin;
  1261.             fill._x = _loc3_._x - ctrl.fillWidth + ctrl.maskWidth * percent / 100;
  1262.             fill._y = ctrl._y + ctrl.fillTopMargin;
  1263.          }
  1264.          else
  1265.          {
  1266.             fill._x = ctrl._x + ctrl.fillLeftMargin;
  1267.             fill._y = ctrl._y + ctrl.fillTopMargin;
  1268.             _loc3_._x = fill._x;
  1269.             _loc3_._y = fill._y;
  1270.             _loc3_._width = (ctrl._width - ctrl.fillRightMargin - ctrl.fillLeftMargin) * percent / 100;
  1271.             _loc3_._height = ctrl._height - ctrl.fillTopMargin - ctrl.fillBottomMargin;
  1272.          }
  1273.       }
  1274.    }
  1275.    function startHandleDrag(controlIndex)
  1276.    {
  1277.       var _loc2_ = this.controls[controlIndex];
  1278.       var _loc5_ = _loc2_.handle_mc;
  1279.       if(_loc2_.startHandleDrag == undefined || !_loc2_.startHandleDrag())
  1280.       {
  1281.          var _loc3_ = _loc2_._y + _loc2_.handleY;
  1282.          var _loc4_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1283.          _loc5_.startDrag(false,_loc2_._x + _loc2_.handleLeftMargin,_loc3_,_loc2_._x + _loc4_ - _loc2_.handleRightMargin,_loc3_);
  1284.       }
  1285.       _loc2_.isDragging = true;
  1286.    }
  1287.    function stopHandleDrag(controlIndex)
  1288.    {
  1289.       var _loc2_ = this.controls[controlIndex];
  1290.       var _loc3_ = _loc2_.handle_mc;
  1291.       if(_loc2_.stopHandleDrag == undefined || !_loc2_.stopHandleDrag())
  1292.       {
  1293.          _loc3_.stopDrag();
  1294.       }
  1295.       _loc2_.isDragging = false;
  1296.    }
  1297.    function positionHandle(controlIndex)
  1298.    {
  1299.       var _loc2_ = this.controls[controlIndex];
  1300.       var _loc3_ = _loc2_.handle_mc;
  1301.       if(_loc3_ == undefined)
  1302.       {
  1303.          return undefined;
  1304.       }
  1305.       if(_loc2_.positionHandle != undefined && _loc2_.positionHandle())
  1306.       {
  1307.          return undefined;
  1308.       }
  1309.       var _loc4_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1310.       var _loc5_ = _loc4_ - _loc2_.handleRightMargin - _loc2_.handleLeftMargin;
  1311.       _loc3_._x = _loc2_._x + _loc2_.handleLeftMargin + _loc5_ * _loc2_.percentage / 100;
  1312.       _loc3_._y = _loc2_._y + _loc2_.handleY;
  1313.       if(_loc2_.fullness_mc != undefined)
  1314.       {
  1315.          this.positionBar(_loc2_,"fullness",_loc2_.percentage);
  1316.       }
  1317.    }
  1318.    function positionBar(ctrl, type, percent)
  1319.    {
  1320.       if(ctrl.positionBar != undefined && ctrl.positionBar(type,percent))
  1321.       {
  1322.          return undefined;
  1323.       }
  1324.       var _loc2_ = ctrl[type + "_mc"];
  1325.       if(_loc2_._parent == ctrl)
  1326.       {
  1327.          if(_loc2_.fill_mc == undefined)
  1328.          {
  1329.             _loc2_._xscale = ctrl[type + "XScale"] * percent / 100;
  1330.          }
  1331.          else
  1332.          {
  1333.             this.positionMaskedFill(_loc2_,_loc2_.fill_mc,percent);
  1334.          }
  1335.       }
  1336.       else
  1337.       {
  1338.          _loc2_._x = ctrl._x + ctrl[type + "LeftMargin"];
  1339.          _loc2_._y = ctrl._y + ctrl[type + "Y"];
  1340.          if(_loc2_.fill_mc == undefined)
  1341.          {
  1342.             _loc2_._width = (ctrl._width - ctrl[type + "LeftMargin"] - ctrl[type + "RightMargin"]) * percent / 100;
  1343.          }
  1344.          else
  1345.          {
  1346.             this.positionMaskedFill(_loc2_,_loc2_.fill_mc,percent);
  1347.          }
  1348.       }
  1349.    }
  1350.    function calcPercentageFromHandle(controlIndex)
  1351.    {
  1352.       var _loc2_ = this.controls[controlIndex];
  1353.       var _loc5_ = _loc2_.handle_mc;
  1354.       if(_loc2_.calcPercentageFromHandle == undefined || !_loc2_.calcPercentageFromHandle())
  1355.       {
  1356.          var _loc3_ = _loc2_.origWidth != undefined ? _loc2_.origWidth : _loc2_._width;
  1357.          var _loc6_ = _loc3_ - _loc2_.handleRightMargin - _loc2_.handleLeftMargin;
  1358.          var _loc4_ = _loc5_._x - (_loc2_._x + _loc2_.handleLeftMargin);
  1359.          _loc2_.percentage = _loc4_ / _loc6_ * 100;
  1360.          if(_loc2_.fullness_mc != undefined)
  1361.          {
  1362.             this.positionBar(_loc2_,"fullness",_loc2_.percentage);
  1363.          }
  1364.       }
  1365.       if(_loc2_.percentage < 0)
  1366.       {
  1367.          _loc2_.percentage = 0;
  1368.       }
  1369.       if(_loc2_.percentage > 100)
  1370.       {
  1371.          _loc2_.percentage = 100;
  1372.       }
  1373.    }
  1374.    function handleRelease(controlIndex)
  1375.    {
  1376.       var _loc3_ = this._vc.activeVideoPlayerIndex;
  1377.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1378.       if(controlIndex == mx.video.UIManager.SEEK_BAR)
  1379.       {
  1380.          this.seekBarListener(true);
  1381.       }
  1382.       else if(controlIndex == mx.video.UIManager.VOLUME_BAR)
  1383.       {
  1384.          this.volumeBarListener(true);
  1385.       }
  1386.       this.stopHandleDrag(controlIndex);
  1387.       this._vc.activeVideoPlayerIndex = _loc3_;
  1388.       if(controlIndex == mx.video.UIManager.SEEK_BAR)
  1389.       {
  1390.          this._vc._scrubFinish();
  1391.       }
  1392.    }
  1393.    function seekBarListener(finish)
  1394.    {
  1395.       var _loc3_ = this._vc.activeVideoPlayerIndex;
  1396.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1397.       var _loc4_ = this.controls[mx.video.UIManager.SEEK_BAR];
  1398.       this.calcPercentageFromHandle(mx.video.UIManager.SEEK_BAR);
  1399.       var _loc2_ = _loc4_.percentage;
  1400.       if(finish)
  1401.       {
  1402.          clearInterval(this._seekBarIntervalID);
  1403.          this._seekBarIntervalID = 0;
  1404.          if(_loc2_ != this._lastScrubPos)
  1405.          {
  1406.             this._vc.seekPercent(_loc2_);
  1407.          }
  1408.          this._vc.addEventListener("playheadUpdate",this);
  1409.          if(this._playAfterScrub)
  1410.          {
  1411.             this._vc.play();
  1412.          }
  1413.       }
  1414.       else if(this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex).state != mx.video.VideoPlayer.SEEKING)
  1415.       {
  1416.          if(this._seekBarScrubTolerance <= 0 || Math.abs(_loc2_ - this._lastScrubPos) > this._seekBarScrubTolerance || _loc2_ < this._seekBarScrubTolerance || _loc2_ > 100 - this._seekBarScrubTolerance)
  1417.          {
  1418.             if(_loc2_ != this._lastScrubPos)
  1419.             {
  1420.                this._lastScrubPos = _loc2_;
  1421.                this._vc.seekPercent(_loc2_);
  1422.             }
  1423.          }
  1424.       }
  1425.       this._vc.activeVideoPlayerIndex = _loc3_;
  1426.    }
  1427.    function volumeBarListener(finish)
  1428.    {
  1429.       var _loc3_ = this.controls[mx.video.UIManager.VOLUME_BAR];
  1430.       this.calcPercentageFromHandle(mx.video.UIManager.VOLUME_BAR);
  1431.       var _loc2_ = _loc3_.percentage;
  1432.       if(finish)
  1433.       {
  1434.          clearInterval(this._volumeBarIntervalID);
  1435.          this._volumeBarIntervalID = 0;
  1436.          this._vc.addEventListener("volumeUpdate",this);
  1437.       }
  1438.       if(finish || this._volumeBarScrubTolerance <= 0 || Math.abs(_loc2_ - this._lastVolumePos) > this._volumeBarScrubTolerance || _loc2_ < this._volumeBarScrubTolerance || _loc2_ > 100 - this._volumeBarScrubTolerance)
  1439.       {
  1440.          if(_loc2_ != this._lastVolumePos)
  1441.          {
  1442.             if(this._isMuted)
  1443.             {
  1444.                this.cachedSoundLevel = _loc2_;
  1445.             }
  1446.             else
  1447.             {
  1448.                this._vc.volume = _loc2_;
  1449.             }
  1450.          }
  1451.       }
  1452.    }
  1453.    function doBufferingDelay()
  1454.    {
  1455.       clearInterval(this._bufferingDelayIntervalID);
  1456.       this._bufferingDelayIntervalID = 0;
  1457.       var _loc2_ = this._vc.activeVideoPlayerIndex;
  1458.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1459.       if(this._vc.state == mx.video.FLVPlayback.BUFFERING)
  1460.       {
  1461.          this._bufferingOn = true;
  1462.          this.handleEvent({type:"stateChange",state:mx.video.FLVPlayback.BUFFERING,vp:this._vc.visibleVideoPlayerIndex});
  1463.       }
  1464.       this._vc.activeVideoPlayerIndex = _loc2_;
  1465.    }
  1466.    function dispatchMessage(ctrl)
  1467.    {
  1468.       if(ctrl.id == mx.video.UIManager.SEEK_BAR_HANDLE)
  1469.       {
  1470.          this._vc._scrubStart();
  1471.       }
  1472.       var _loc2_ = this._vc.activeVideoPlayerIndex;
  1473.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1474.       switch(ctrl.id)
  1475.       {
  1476.          case mx.video.UIManager.PAUSE_BUTTON:
  1477.             this._vc.pause();
  1478.             break;
  1479.          case mx.video.UIManager.PLAY_BUTTON:
  1480.             this._vc.play();
  1481.             break;
  1482.          case mx.video.UIManager.STOP_BUTTON:
  1483.             this._vc.stop();
  1484.             break;
  1485.          case mx.video.UIManager.SEEK_BAR_HANDLE:
  1486.             this.calcPercentageFromHandle(mx.video.UIManager.SEEK_BAR);
  1487.             this._lastScrubPos = this.controls[mx.video.UIManager.SEEK_BAR].percentage;
  1488.             this._vc.removeEventListener("playheadUpdate",this);
  1489.             if(this._vc.playing || this._vc.buffering)
  1490.             {
  1491.                this._playAfterScrub = true;
  1492.             }
  1493.             else if(this._vc.state != mx.video.VideoPlayer.SEEKING)
  1494.             {
  1495.                this._playAfterScrub = false;
  1496.             }
  1497.             this._seekBarIntervalID = setInterval(this,"seekBarListener",this._seekBarInterval,false);
  1498.             this.startHandleDrag(mx.video.UIManager.SEEK_BAR,mx.video.UIManager.SEEK_BAR_HANDLE);
  1499.             this._vc.pause();
  1500.             break;
  1501.          case mx.video.UIManager.VOLUME_BAR_HANDLE:
  1502.             this.calcPercentageFromHandle(mx.video.UIManager.VOLUME_BAR);
  1503.             this._lastVolumePos = this.controls[mx.video.UIManager.VOLUME_BAR].percentage;
  1504.             this._vc.removeEventListener("volumeUpdate",this);
  1505.             this._volumeBarIntervalID = setInterval(this,"volumeBarListener",this._volumeBarInterval,false);
  1506.             this.startHandleDrag(mx.video.UIManager.VOLUME_BAR,mx.video.UIManager.VOLUME_BAR_HANDLE);
  1507.             break;
  1508.          case mx.video.UIManager.BACK_BUTTON:
  1509.             this._vc.seekToPrevNavCuePoint();
  1510.             break;
  1511.          case mx.video.UIManager.FORWARD_BUTTON:
  1512.             this._vc.seekToNextNavCuePoint();
  1513.             break;
  1514.          case mx.video.UIManager.MUTE_ON_BUTTON:
  1515.          case mx.video.UIManager.MUTE_OFF_BUTTON:
  1516.             if(!this._isMuted)
  1517.             {
  1518.                this._isMuted = true;
  1519.                this.cachedSoundLevel = this._vc.volume;
  1520.                this._vc.volume = 0;
  1521.             }
  1522.             else
  1523.             {
  1524.                this._isMuted = false;
  1525.                this._vc.volume = this.cachedSoundLevel;
  1526.             }
  1527.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_OFF_BUTTON,mx.video.FLVPlayback.PLAYING);
  1528.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_OFF_BUTTON]);
  1529.             this.setEnabledAndVisibleForState(mx.video.UIManager.MUTE_ON_BUTTON,mx.video.FLVPlayback.PLAYING);
  1530.             this.skinButtonControl(this.controls[mx.video.UIManager.MUTE_ON_BUTTON]);
  1531.             break;
  1532.          default:
  1533.             throw new Error("Unknown ButtonControl");
  1534.       }
  1535.       this._vc.activeVideoPlayerIndex = _loc2_;
  1536.    }
  1537.    function setEnabledAndVisibleForState(index, state)
  1538.    {
  1539.       var _loc5_ = this._vc.activeVideoPlayerIndex;
  1540.       this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex;
  1541.       var _loc3_ = state;
  1542.       if(_loc3_ == mx.video.FLVPlayback.BUFFERING && !this._bufferingOn)
  1543.       {
  1544.          _loc3_ = mx.video.FLVPlayback.PLAYING;
  1545.       }
  1546.       switch(index)
  1547.       {
  1548.          case mx.video.UIManager.VOLUME_BAR:
  1549.          case mx.video.UIManager.VOLUME_BAR_HANDLE:
  1550.             this.controls[index].myEnabled = true;
  1551.             this.controls[index].enabled = this._controlsEnabled;
  1552.             break;
  1553.          case mx.video.UIManager.MUTE_ON_BUTTON:
  1554.             this.controls[index].myEnabled = !this._isMuted;
  1555.             if(this.controls[mx.video.UIManager.MUTE_BUTTON] != undefined)
  1556.             {
  1557.                this.controls[index]._visible = this.controls[index].myEnabled;
  1558.             }
  1559.             break;
  1560.          case mx.video.UIManager.MUTE_OFF_BUTTON:
  1561.             this.controls[index].myEnabled = this._isMuted;
  1562.             if(this.controls[mx.video.UIManager.MUTE_BUTTON] != undefined)
  1563.             {
  1564.                this.controls[index]._visible = this.controls[index].myEnabled;
  1565.             }
  1566.             break;
  1567.          default:
  1568.             switch(_loc3_)
  1569.             {
  1570.                case mx.video.FLVPlayback.LOADING:
  1571.                case mx.video.FLVPlayback.CONNECTION_ERROR:
  1572.                   this.controls[index].myEnabled = false;
  1573.                   break;
  1574.                case mx.video.FLVPlayback.DISCONNECTED:
  1575.                   this.controls[index].myEnabled = this._vc.contentPath != undefined;
  1576.                   break;
  1577.                case mx.video.FLVPlayback.SEEKING:
  1578.                   break;
  1579.                default:
  1580.                   this.controls[index].myEnabled = true;
  1581.             }
  1582.       }
  1583.       switch(index)
  1584.       {
  1585.          case mx.video.UIManager.SEEK_BAR:
  1586.             switch(_loc3_)
  1587.             {
  1588.                case mx.video.FLVPlayback.STOPPED:
  1589.                case mx.video.FLVPlayback.PLAYING:
  1590.                case mx.video.FLVPlayback.PAUSED:
  1591.                case mx.video.FLVPlayback.REWINDING:
  1592.                case mx.video.FLVPlayback.SEEKING:
  1593.                   this.controls[index].myEnabled = true;
  1594.                   break;
  1595.                case mx.video.FLVPlayback.BUFFERING:
  1596.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1597.                   break;
  1598.                default:
  1599.                   this.controls[index].myEnabled = false;
  1600.             }
  1601.             if(this.controls[index].myEnabled)
  1602.             {
  1603.                this.controls[index].myEnabled = !isNaN(this._vc.totalTime) && this._vc.totalTime > 0;
  1604.             }
  1605.             this.controls[index].handle_mc.myEnabled = this.controls[index].myEnabled;
  1606.             this.controls[index].handle_mc.enabled = this.controls[index].handle_mc.myEnabled;
  1607.             this.controls[index].handle_mc._visible = this.controls[index].myEnabled;
  1608.             var _loc4_ = !this._bufferingBarHides || this.controls[index].myEnabled || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined || !this.controls[mx.video.UIManager.BUFFERING_BAR]._visible;
  1609.             this.controls[index]._visible = _loc4_;
  1610.             this.controls[index].progress_mc._visible = _loc4_;
  1611.             this.controls[index].progress_mc.fill_mc._visible = _loc4_;
  1612.             this.controls[index].fullness_mc._visible = _loc4_;
  1613.             this.controls[index].progress_mc.fill_mc._visible = _loc4_;
  1614.             break;
  1615.          case mx.video.UIManager.BUFFERING_BAR:
  1616.             switch(_loc3_)
  1617.             {
  1618.                case mx.video.FLVPlayback.STOPPED:
  1619.                case mx.video.FLVPlayback.PLAYING:
  1620.                case mx.video.FLVPlayback.PAUSED:
  1621.                case mx.video.FLVPlayback.REWINDING:
  1622.                case mx.video.FLVPlayback.SEEKING:
  1623.                   this.controls[index].myEnabled = false;
  1624.                   break;
  1625.                default:
  1626.                   this.controls[index].myEnabled = true;
  1627.             }
  1628.             this.controls[index]._visible = this.controls[index].myEnabled;
  1629.             this.controls[index].fill_mc._visible = this.controls[index].myEnabled;
  1630.             break;
  1631.          case mx.video.UIManager.PAUSE_BUTTON:
  1632.             switch(_loc3_)
  1633.             {
  1634.                case mx.video.FLVPlayback.DISCONNECTED:
  1635.                case mx.video.FLVPlayback.STOPPED:
  1636.                case mx.video.FLVPlayback.PAUSED:
  1637.                case mx.video.FLVPlayback.REWINDING:
  1638.                   this.controls[index].myEnabled = false;
  1639.                   break;
  1640.                case mx.video.FLVPlayback.PLAYING:
  1641.                   this.controls[index].myEnabled = true;
  1642.                   break;
  1643.                case mx.video.FLVPlayback.BUFFERING:
  1644.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1645.             }
  1646.             if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] != undefined)
  1647.             {
  1648.                this.controls[index]._visible = this.controls[index].myEnabled;
  1649.             }
  1650.             break;
  1651.          case mx.video.UIManager.PLAY_BUTTON:
  1652.             switch(_loc3_)
  1653.             {
  1654.                case mx.video.FLVPlayback.PLAYING:
  1655.                   this.controls[index].myEnabled = false;
  1656.                   break;
  1657.                case mx.video.FLVPlayback.STOPPED:
  1658.                case mx.video.FLVPlayback.PAUSED:
  1659.                   this.controls[index].myEnabled = true;
  1660.                   break;
  1661.                case mx.video.FLVPlayback.BUFFERING:
  1662.                   this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1663.             }
  1664.             if(this.controls[mx.video.UIManager.PLAY_PAUSE_BUTTON] != undefined)
  1665.             {
  1666.                this.controls[index]._visible = !this.controls[mx.video.UIManager.PAUSE_BUTTON]._visible;
  1667.             }
  1668.             break;
  1669.          case mx.video.UIManager.STOP_BUTTON:
  1670.             switch(_loc3_)
  1671.             {
  1672.                case mx.video.FLVPlayback.DISCONNECTED:
  1673.                case mx.video.FLVPlayback.STOPPED:
  1674.                   this.controls[index].myEnabled = false;
  1675.                   break;
  1676.                case mx.video.FLVPlayback.PAUSED:
  1677.                case mx.video.FLVPlayback.PLAYING:
  1678.                case mx.video.FLVPlayback.BUFFERING:
  1679.                   this.controls[index].myEnabled = true;
  1680.             }
  1681.             break;
  1682.          case mx.video.UIManager.BACK_BUTTON:
  1683.          case mx.video.UIManager.FORWARD_BUTTON:
  1684.             if(_loc3_ !== mx.video.FLVPlayback.BUFFERING)
  1685.             {
  1686.                break;
  1687.             }
  1688.             this.controls[index].myEnabled = !this._bufferingBarHides || this.controls[mx.video.UIManager.BUFFERING_BAR] == undefined;
  1689.             break;
  1690.       }
  1691.       this.controls[index].enabled = this._controlsEnabled && this.controls[index].myEnabled;
  1692.       this._vc.activeVideoPlayerIndex = _loc5_;
  1693.    }
  1694.    function setupSkinAutoHide()
  1695.    {
  1696.       var _loc2_ = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex);
  1697.       if(this._skinAutoHide && this.skin_mc != undefined)
  1698.       {
  1699.          this.skinAutoHideHitTest();
  1700.          if(this._skinAutoHideIntervalID == 0)
  1701.          {
  1702.             this._skinAutoHideIntervalID = setInterval(this,"skinAutoHideHitTest",mx.video.UIManager.SKIN_AUTO_HIDE_INTERVAL);
  1703.          }
  1704.       }
  1705.       else
  1706.       {
  1707.          this.skin_mc._visible = this.__visible;
  1708.          clearInterval(this._skinAutoHideIntervalID);
  1709.          this._skinAutoHideIntervalID = 0;
  1710.       }
  1711.    }
  1712.    function skinAutoHideHitTest()
  1713.    {
  1714.       if(!this.__visible)
  1715.       {
  1716.          this.skin_mc._visible = false;
  1717.       }
  1718.       else
  1719.       {
  1720.          var _loc4_ = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex);
  1721.          var _loc3_ = _loc4_.hitTest(_root._xmouse,_root._ymouse,true);
  1722.          if(!_loc3_ && this.border_mc != undefined)
  1723.          {
  1724.             _loc3_ = this.border_mc.hitTest(_root._xmouse,_root._ymouse,true);
  1725.          }
  1726.          this.skin_mc._visible = _loc3_;
  1727.       }
  1728.    }
  1729. }
  1730.